﻿using System;
using System.Collections.Generic;
using System.Text;
using libCommonClass;
using libReadWrite;

namespace TTServer.Messages
{
    public class MouseClickMessage : TTMessage
    {

        public static readonly int BUTTON_LEFT = 1;
        public static readonly int BUTTON_MIDDLE = 2;
        public static readonly int BUTTON_RIGHT = 3;


        public static readonly int STATE_DOWN = 1;
        public static readonly int STATE_UP = 2;
        public static readonly int STATE_DOWNUP = 3;

        private String _temporaryKey = "";

        public String TemporaryKey
        {
            get { return _temporaryKey; }
            set { _temporaryKey = value; }
        }

        private int _button;

        public int Button
        {
            get { return _button; }
            set { _button = value; }
        }

        private int _state;

        public int State
        {
            get { return _state; }
            set { _state = value; }
        }

        public MouseClickMessage()
        {

        }

        public override void ReadMessage(BigEndianReader sr)
        {
            this.TemporaryKey = sr.ReadString();

            this._button = sr.ReadByte();

            this._state = sr.ReadByte();
        }

        public override void WriteMessage(BigEndianWriter sw)
        {
            throw new NotImplementedException();
        }

        public override TTMessage Clone()
        {
            return (new MouseClickMessage());
        }

        public override int GetMessageID()
        {
            return MessageKind.MOUSE_CLICK;
        }

        public override string GetMessageName()
        {
            return "MouseClickMessage";
        }
    }
}
